﻿<div ng-controller="Administration">
    <h1 class="page-header">Administration</h1>

    <p ng-show="!cluster.length">
        No data.
    </p>

    <div ng-show="cluster.length" ng-repeat="node in cluster">
        <h3>{{node.name}} ({{node.memory}})</h3>

        <table class="table table-striped table-hover">
            <thead>
                <tr>
                    <th>Date</th>
                    <th>Type</th>
                    <th>Branch &amp; Build</th>
                    <th>Container</th>
                    <th>Expires</th>
                    <th>Release</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td ng-show="!node.items.length" colspan="6">
                        No data.
                    </td>
                </tr>
                <tr ng-show="node.items.length" ng-repeat="item in node.items">
                    <td>{{item.date}}</td>
                    <td>{{item.type}}</td>
                    <td>{{item.branch}} {{item.build}}</td>
                    <td><a href="{{item.container.server}}" target="_blank">{{item.container.server}}</a><br />{{item.container.client}}</td>
                    <td>{{item.expires}}</td>
                    <td>
                        <button class="btn btn-default" ng-click="release(item.id)">
                            <span class="glyphicon glyphicon-remove"></span> Release
                        </button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>

</div>
